package com.zff.rental.controller.oss;

import com.tencent.cloud.Response;
import com.zff.rental.AppConstant;
import com.zff.rental.common.Result;
import com.zff.rental.service.oss.TencentCosService;
import com.zff.rental.vo.cos.TencentCosParams;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 腾讯云COS
 *
 * @author HCY
 */
@RestController
@RequestMapping(AppConstant.RM_TENCENT_COS)
public class TencentCosController {
    @Resource
    private TencentCosService tencentCosService;

    /**
     * 获取临时凭证
     */
    @PostMapping("/getCredential")
    public Result<Response> getCredential(@RequestBody TencentCosParams params) {
        Response credential = tencentCosService.getCredential(params);
        return Result.success(credential);
    }
}
